package com.slz3.business.module.goodsManagement.gooBaseGoodsSpecificationValue.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.goodsManagement.gooBaseGoodsSpecificationValue.domain.GooBaseGoodsSpecificationValue;
import com.slz3.business.module.goodsManagement.gooBaseGoodsSpecificationValue.domain.GooBaseGoodsSpecificationValueCondition;
import org.springframework.stereotype.Controller;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

import javax.annotation.Resource;

@Controller
public class GooBaseGoodsSpecificationValueResController {

    @Resource
    private GooBaseGoodsSpecificationValueResAtomic gooBaseGoodsSpecificationValueResAtomic;

    public Mono<ServerResponse> add(ServerRequest req, GooBaseGoodsSpecificationValue gooBaseGoodsSpecificationValue) {
        if (GooBaseGoodsSpecificationValueResUnsafeValid.add(req, gooBaseGoodsSpecificationValue)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return gooBaseGoodsSpecificationValueResAtomic.add_$GooBaseGoodsSpecificationValueUpdateLock(req, gooBaseGoodsSpecificationValue);
        }
    }

    public Mono<ServerResponse> delete(ServerRequest req, GooBaseGoodsSpecificationValueCondition gooBaseGoodsSpecificationValueCondition) {
        if (GooBaseGoodsSpecificationValueResUnsafeValid.delete(req, gooBaseGoodsSpecificationValueCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return gooBaseGoodsSpecificationValueResAtomic.delete_$GooBaseGoodsSpecificationValueUpdateLock(req, gooBaseGoodsSpecificationValueCondition);
        }
    }

    public Mono<ServerResponse> modify(ServerRequest req, GooBaseGoodsSpecificationValue gooBaseGoodsSpecificationValue) {
        if (GooBaseGoodsSpecificationValueResUnsafeValid.modify(req, gooBaseGoodsSpecificationValue)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return gooBaseGoodsSpecificationValueResAtomic.modify_$GooBaseGoodsSpecificationValueUpdateLock(req, gooBaseGoodsSpecificationValue);
        }
    }

    public Mono<ServerResponse> list(ServerRequest req) {
        if (GooBaseGoodsSpecificationValueResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return GooBaseGoodsSpecificationValueResExecutor.list(req);
        }
    }

    public Mono<ServerResponse> info(ServerRequest req) {
//        return gooBaseGoodsSpecificationValueResAtomic.info_$GooBaseGoodsSpecificationValueUpdateLock(req);
        if (GooBaseGoodsSpecificationValueResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return gooBaseGoodsSpecificationValueResAtomic.info_$GooBaseGoodsSpecificationValueUpdateLock(req);
        }
    }

    public Mono<ServerResponse> choice(ServerRequest req) {
        if (GooBaseGoodsSpecificationValueResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return GooBaseGoodsSpecificationValueResExecutor.choice(req);
        }
    }

    public Mono<ServerResponse> auditSubmit(ServerRequest req, GooBaseGoodsSpecificationValueCondition gooBaseGoodsSpecificationValueCondition) {
        //
        if (GooBaseGoodsSpecificationValueResUnsafeValid.auditSubmit(req, gooBaseGoodsSpecificationValueCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return gooBaseGoodsSpecificationValueResAtomic.auditSubmit_$GooBaseGoodsSpecificationValueUpdateLock(req, gooBaseGoodsSpecificationValueCondition);
        }
    }

    public Mono<ServerResponse> audit(ServerRequest req, GooBaseGoodsSpecificationValueCondition gooBaseGoodsSpecificationValueCondition) {
        if (GooBaseGoodsSpecificationValueResUnsafeValid.audit(req, gooBaseGoodsSpecificationValueCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return gooBaseGoodsSpecificationValueResAtomic.audit_$GooBaseGoodsSpecificationValueUpdateLock(req, gooBaseGoodsSpecificationValueCondition);
        }
    }

    public Mono<ServerResponse> auditReject(ServerRequest req, GooBaseGoodsSpecificationValueCondition gooBaseGoodsSpecificationValueCondition) {
        if (GooBaseGoodsSpecificationValueResUnsafeValid.auditReject(req, gooBaseGoodsSpecificationValueCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return gooBaseGoodsSpecificationValueResAtomic.auditReject_$GooBaseGoodsSpecificationValueUpdateLock(req, gooBaseGoodsSpecificationValueCondition);
        }
    }

    public Mono<ServerResponse> usingEnable(ServerRequest req, GooBaseGoodsSpecificationValueCondition gooBaseGoodsSpecificationValueCondition) {
        if (GooBaseGoodsSpecificationValueResUnsafeValid.usingEnable(req, gooBaseGoodsSpecificationValueCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return gooBaseGoodsSpecificationValueResAtomic.usingEnable_$GooBaseGoodsSpecificationValueUpdateLock(req, gooBaseGoodsSpecificationValueCondition);
        }
    }

    public Mono<ServerResponse> usingDisable(ServerRequest req, GooBaseGoodsSpecificationValueCondition gooBaseGoodsSpecificationValueCondition) {
        if (GooBaseGoodsSpecificationValueResUnsafeValid.usingDisable(req, gooBaseGoodsSpecificationValueCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return gooBaseGoodsSpecificationValueResAtomic.usingDisable_$GooBaseGoodsSpecificationValueUpdateLock(req, gooBaseGoodsSpecificationValueCondition);
        }
    }

}
